package com.sino.operation.controller;

import com.sino.operation.commons.response.CenterResponseEntity;
import com.sino.operation.param.out.EscReciveByCounter;
import com.sino.operation.peripheral.esc.response.EscResponseDto;
import com.sino.operation.util.EscResTest;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.HashMap;

/**
 * 行内转账业务入口
 */
@Slf4j
@RestController
@RequestMapping("innerTrance")
@Api(value = "行内转账",tags = "行内转账的发起、查询等信息")
public class InnerTranceController {


   @RequestMapping("/startInnerTrance")
   @ResponseBody
   public EscResponseDto startInnerTrance(@RequestBody @Valid EscReciveByCounter escReciveByCounter){
//       InnerTranceVo innerTranceVo=(InnerTranceVo) escReciveByCounter.getEscBody().getObject();
//       log.info("流程发起报文:"+innerTranceVo.toString());
//       CenterResponseEntity<Object> responseEntity = new CenterResponseEntity<>();
//       HashMap<Object, Object> map = new HashMap<>();
//       map.put("流水号","BPR123456789");
//       responseEntity.setCode(200);
//       responseEntity.setMsg("请求成功！！");
//       responseEntity.setData(map);
//       return responseEntity;
       CenterResponseEntity<Object> build = CenterResponseEntity.build(Object.class);
       HashMap<Object, Object> map = new HashMap<>();
       map.put("流水号","BPR123456789");
       build.setData(map);
       EscResponseDto escReponse = EscResTest.getEscReponse();
       escReponse.getEscResBody().setCenterResponseEntity(build);
       return escReponse;
   }

}
